package com.itheima.Test;

public class Factory {
    //这个方法是专门造车的方法
    public static Car getCar(String name) {
        if(name.equals("宝马")){
            return new BaoMa();
        }else if(name.equals("奔驰")){
            return new BenChi();
        }
        return null;
    }
}